PutMessage('Please select an area of interest in the Camera window.');
exit;
end;
nFrames:=GetNumber('Number of frames:',4);
StartCapturing;
Camera:=nPics;
n:=0;
repeat
if Button then begin
MakeRoi(left,top,width,height);
n:=n+1;
Duplicate('Frame ',n:1);
SelectPic(Camera);
StartCapturing;
end;
until n=nFrames;
StopCapturing;
Dispose;
SetOption; TileWindows;
end;
procedure ExtractEvenField(NewWindow:boolean);
{
Replaces odd scan lines with average of neighboring even lines. Can be used to improve the quality of images that have even and odd fields that are out of sync as the result of subject movement during capture.
}
var
i,width,height,row1,row2:integer;
begin
SaveState;
if NewWindow then Duplicate('Even Field');
GetPicSize(width,height);
row1:=0; row2:=0;
for i:=1 to height/2 do begin
GetRow(0,row1,width);
PutRow(0,row2,width);
row1:=row1+2;
row2:=row2+1;
end;
MakeRoi(0,0,width,height/2);
Copy;
MakeRoi(0,height/4-1,width,height/2);
Paste;
RestoreRoi;
SetScaling('Bilinear; Same Window');
ScaleAndRotate(1,2,0);
RestoreState;
end;
macro 'Extract Even Field->New Window';
begin
ExtractEvenField(true);
end;
macro 'Extract Even Field->Same Window';
begin
ExtractEvenField(false);
end;
macro 'Make Movie to Disk';
{
Captures a specified number of images at a specified rate and
saves them to disk. Select an area of interest within the Camera
window before starting.
}
var
nFrames,n,Left,Top,Width,Height:integer;
Delay:real;
begin
GetRoi(Left,Top,Width,Height);
if width=0 then begin
PutMessage('First select the area of interest in the Camera window.');
exit;
end;
nFrames:=GetNumber('Number of Frames?',10);
delay:=GetNumber('Delay Between Frames(seconds)?',60);
for n:=1 to nFrames do begin
StopCapturing;
MakeRoi(Left,Top,Width,Height);
SetPicName('Frame ',n);
SaveAs;
StartCapturing;
Wait(delay);
beep;
end;
StopCapturing;
end;
macro 'Camera and Light Source Test';
{Use to test cameras and light sources for temporal stability.}
var
delay,nFrames:integer;
i:real;
begin
nFrames:=trunc(GetNumber('Number of Frames:',10));